#!/bin/bash

gdb_get_backtrace() {
#src: https://wiki.gentoo.org/wiki/Project:Quality_Assurance/Backtraces
    local exe=$1
    local core=$2
 
    gdb ${exe} \
        --core ${core} \
        --batch \
        --quiet \
        -ex "thread apply all bt full" \
        -ex "quit"
}

gdb_get_backtrace "$@"

